package com.eliza.springboot.v3

import com.eliza.springboot.v3.repository.entity.Song
import com.eliza.springboot.v3.repository.repo.mongo.SongMongoRepository
import com.eliza.springboot.v3.repository.repo.postgresql.SongRepository
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest


@SpringBootTest
class V3ApplicationTests {

    @Autowired
    private lateinit var songRepository: SongRepository

    @Test
    fun contextLoads() {
//        userRepository.save(Song(0, "AAA", 10))
//        userRepository.save(Song(0, "BBB", 20))
        val size = songRepository.findAll()
        size.forEach {
            println(it)
        }


    }

    @Autowired
    private lateinit var songMongoRepository: SongMongoRepository

    @Test
    fun mongo() {
        songMongoRepository.save(Song(12, "some title", "some description"))
    }
}
